<template>
	<view class="box">
		<view class="box1">
			<view class="title1 fw-bt">
				<!-- 地址选择 -->
				<view class="address f-w" @click="gochooseadd">
					<view class="img">
						<image src="https://jw.xzsw2021.com/static/index/icon_30@2x.png" mode=""></image>
					</view>
					<view>
						<!-- 	<u-picker @cancel="show = false" @confirm="sureShop" :show="show" :columns="columns"
							confirmColor="#22B591" keyName="mar_name"></u-picker> -->
						<view @click="show = true">{{myshop?myshop.mar_name:'加载中'}}</view>
					</view>
				</view>
				<!-- 消息通知 -->
				<view class="notify" @click="goNotify">
					<view class="img">
						<image src="https://jw.xzsw2021.com/static/index/icon_31@2x.png" mode=""></image>
						<view class="jiaobiao">{{newsNum}}</view>
					</view>
				</view>
			</view>
			<!-- 搜索 -->
			<view class="search f-w" @click="goSearch">
				<view class="img f-w">
					<image src="https://jw.xzsw2021.com/static/index/icon_32@2x.png" mode=""></image>
				</view>
				<view class="input">
					<input type="text" value="" placeholder="请输入搜索内容" disabled />
				</view>
			</view>
			<!-- 轮播图 -->
			<view class="swiper">
				<u-swiper :list="bannerList" keyName="pic" indicator indicatorMode="dot" radius="0" circular
					height="120" @click="goUrl" indicatorActiveColor="#27B18B" indicatorInactiveColor="#fff"></u-swiper>
			</view>
			<!-- 系统通知 -->
			<view class="notice f-w" v-if="noticeS.length">
				<image src="https://jw.xzsw2021.com/static/index/home_notice_gif.gif" mode="widthFix"></image>
				<view class="" style="font-size: 24rpx;color: #333333;">
					平台公告
				</view>
				<!-- 纵向轮播图 -->
				<view class="text hide-line">
					<u-notice-bar :icon="' '" size="11" :text="noticeS" @click="goNotice" bgColor="-"></u-notice-bar>
					<!-- <swiper class="swiper" vertical :autoplay="false">
						<swiper-item v-for="(item,index) in NoticeList" :key="item.id">
							<view class="swiper-item hide-line" @click="goNotice(item.id)">
								{{item.title}}
							</view>
						</swiper-item>
					</swiper> -->
				</view>
			</view>
			<!-- 商品分类-横向轮播 -->
			<view class="goods">
				<swiper :indicator-dots="true" indicator-active-color="#27B18B" indicator-color="#999999"
					class="goods-swiper">
					<swiper-item v-for="(item,index) of goodsList2" :key="index">
						<view class="swiper-item flex">
							<view class="goods-demo" v-for="(it,ind) of item" :key="ind" @click="goUrl2(it.url)">
								<view class="goods-img f-w">
									<image :src="it.pic" mode=""></image>
								</view>
								<view class="goods-name">{{it.name}}</view>
							</view>
						</view>
					</swiper-item>
				</swiper>
			</view>
		</view>
		<!-- 附近商家 -->
		<view class="shopping card">
			<view class="title fw-bt">
				<view class="bold f32">附近商家</view>
				<view class="more" @click="goShopList">
					<text>更多商家</text>
					<image src="https://jw.xzsw2021.com/static/index/icon_45@2x.png" mode=""></image>
				</view>
			</view>
			<view class="title2 f-w">
				<view :class="active1===index?'c1':''" v-for="(item,index) in nameList" :key="index"
					@click="checkType(index)">{{item.title}}</view>
			</view>
			<!-- 商家 -->
			<view class="shop">
				<view class="flex" @click="goShop(item.mer_id)" v-for="(item,index) in marketlist" :key="index">
					<!-- 图片 -->
					<view class="shop-img">
						<image :src="item.mer_avatar" mode=""></image>
					</view>
					<!-- 店铺信息 -->
					<view class="shop-right fh-bt">
						<view class="shop-one fw-bt">
							<view class="bold f28">{{item.mer_name}}</view>
							<view class="f22 tag" v-if="item.mer_keyword">{{item.mer_keyword}}</view>
						</view>
						<view class="shop-two fw-bt">
							<!-- 评分销量 -->
							<view class="shop-two1 f-w">
								<view class="f-w">
									<uni-rate :value="item.product_score" allow-half size="12" color="#bbb"
										active-color="#FCA223" :readonly="true" />
									<text class="f26 c2" style="margin-left: 4rpx;">{{item.product_score}}</text>
								</view>
								<view class="f-w num">
									<view>月售{{item.sales}}</view>
								</view>
							</view>
							<!-- 配送时长 距离 -->
							<view class="shop-two2 f-w">
								<view class="time">{{item.time_delivery}}分钟</view>
								<view>{{item.km?item.km+'km':''}}</view>
							</view>
						</view>
						<view class="shop-three f-w">
							<view class="price">起送¥{{item.starting_price}}</view>
							<view class="line"></view>
							<view v-if="item.distribution_fee > 0">
								配送费{{item.distribution_fee}}元
							</view>
							<view v-else>免配送费</view>
						</view>
					</view>

				</view>
			</view>
		</view>
		<!-- 今日秒杀 -->
		<view class="skill card" v-if="killTimeObj.seckillEndCountdown && killProductList.length">
			<view class="skill-title f-w" @click="goSkill">

				<view slot="title">
					<view class="bold f32">
						今日秒杀
						<!-- 限时秒杀 -->
						<!-- 今日{{killTimeObj.seckillTime[killTimeObj.seckillTimeIndex].start_time}}-{{killTimeObj.seckillTime[killTimeObj.seckillTimeIndex].end_time}}秒杀 -->
					</view>
				</view>
				<!-- 倒计时 -->
				<view class="countdown f-w">
					<view class="countdown-img f-w">
						<image src="https://jw.xzsw2021.com/static/index/icon_48@2x.png" mode=""></image>
					</view>
					<view class="f22">
						<u-count-down :time="killTimeObj.seckillEndCountdown" @finish="changeTime" format="HH:mm:ss">
						</u-count-down>
					</view>
				</view>
				<view class="rightmore">
					更多<u-icon name="arrow-right"></u-icon>
				</view>

			</view>
			<!-- 秒杀商品 -->
			<view class="skill-shops fw-bt">
				<view class="skill-shop" v-for="(item,index) of killProductList" :key="index"
					@click="goShopDetail(item)">
					<!-- 商品图 -->
					<view class="skill-shop-img f-w">
						<image :src="item.image" mode=""></image>
					</view>
					<!-- 价格 -->
					<view @click.stop=""><text class="skill-shop-price f22">￥{{item.price}}</text></view>
				</view>
			</view>
		</view>
		<!-- 功能块儿 -->
		<view class="funs card flex">
			<view class="funs-img" v-for="(item,index) in hot" :key="index">
				<view class="fnustitle">
					<text>{{item.title}}</text>
					<text :style="'color:'+item.color">{{item.s_title}}</text>
				</view>
				<view class="fnusimg">
					<image :src="item2" mode="" v-for="(item2,index2) in item.pic" :key='index2'
						@click="goDuihuan(index,index2)"></image>
				</view>
			</view>
		</view>
		<!-- 最近常卖/广告栏 -->
		<view class="funs2 fw-bt">
			<!-- 最近常卖 -->
			<view class="zuijin">
				<view class="funs2-title f-w">
					<view class="funs2-img-tag"></view>
					<view class="funs2-img-title bold f32">最近常卖</view>
					<!-- <view class="funs2-img-title bold f32">推荐商品</view> -->
				</view>
				<view class="shop-demo">
					<swiper class="shop-demo-swiper" :autoplay="true" :interval="3000">
						<swiper-item v-for="(item,index) of visitProudctList" :key="index">
							<view class="shop-demo2" :key="index" @click="goShopDetail(item)"
								@longpress="goXiangsi(item.product_id,index)">
								<!--图片 -->
								<view class="shop-img f-w">
									<image :src="item.image" mode=""></image>
								</view>
								<!-- 名字 -->
								<view class="shop-name hide-line2 bold f28">{{item.store_name}}</view>
								<!-- 店名 -->
								<view class="shop-name2 hide-line2">
									{{item.merchant.mer_name}}
								</view>
								<view class="shop-price fw-bt c3">
									<!-- 价格 -->
									<view class="f-w">
										<view class="f24">￥</view>
										<view class="bold f28">{{item.price}}</view>
									</view>
									<!-- 购买按钮 -->
									<view class="shop-btn" @click.stop="goShopDetail(item)">
										<image src="https://jw.xzsw2021.com/static/index/icon_49@2x.png" mode="">
										</image>
									</view>
								</view>
								<!-- 商品图标 -->
								<view class="shop-tag">
									<image :src="item.shop_img" mode=""></image>
								</view>
								<!-- 精选好物 -->
								<view class="shop-good" v-if="item.good">
									<image :src="item.good" mode=""></image>
								</view>
								<!-- 最近浏览过 -->
								<view class="shop-history c3 f22" v-if="item.desc">{{item.desc}}</view>
								<!-- 长按遮罩 -->
								<!-- <view class="shop-xiangsi" v-if="item.isShow" @click.stop="cancelMask(index)">
									<view class="shop-xs2 fw-ct" @click="goXs(index)">
										<image src="https://jw.xzsw2021.com/static/index/icon_32@2x.png" mode=""></image>
										<text>找相似</text>
									</view>
								</view> -->
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
			<!-- 广告栏-视频 -->
			<!-- <view class="adv">
				<view class="funs2-title f-w">
					<view class="funs2-img-tag"></view>
					<view class="funs2-img-title bold f32">广告栏</view>
				</view>
				<view class="zj-img">
					<image :src="ad.home_ad_pic" mode="aspectFill" @click="goUrl2(ad.home_ad_url)"></image>
				</view>
			</view> -->
			<view class="adv">
				<view class="funs2-title f-w">
					<view class="funs2-img-tag"></view>
					<view class="funs2-img-title bold f32">广告栏</view>
				</view>
				<view class="zj-img">
					<!-- <image :src="ad.home_ad_pic" mode="aspectFill" @click="goUrl2(ad.home_ad_url)"></image> -->
					<image v-for="(item,index) in home.advertisement" :src="item.image" @click="goUrl2(item.url)"
						:key="index">
					</image>
				</view>
			</view>
		</view>
		<!-- 商品 -->
		<view class="list">
			<!-- 标题 -->
			<view class="funs2-title f-w">
				<view class="funs2-img-tag"></view>
				<view class="funs2-img-title bold f32">商品</view>
			</view>
			<!-- 商品 -->
			<view class="list2 fw-bt">
				<view class="shop-demo" v-for="(item,index) of shopList" :key="index" @click.stop="goShopDetail(item)"
					@longpress="goXiangsi(item.product_id,index)">
					<!--图片 -->
					<view class="shop-img f-w">
						<image :src="item.image" mode=""></image>
					</view>
					<!-- 名字 -->
					<view class="shop-name hide-line2 bold f28">{{item.store_name}}</view>
					<!-- 店名 -->
					<view class="shop-name2 hide-line2">
						{{item.merchant.mer_name}}
					</view>
					<view class="shop-price fw-bt c3">
						<!-- 价格 -->
						<view class="f-w">
							<view class="f24">￥</view>
							<view class="bold f28">{{item.price}}</view>
						</view>
						<!-- 添加购物车按钮 -->
						<view>
							<!-- <view slot="plus" class="plus"
								@click.stop="addcart(item.product_id,item.productAttrValue.attrValue[0].unique,item.product_type)">
								<image name="plus" src="https://jw.xzsw2021.com/static/client/icon_84@2x.png" mode="">
								</image>
							</view> -->

							<view slot="plus" class="plus" @click.stop>
								<rules :product_id="item.product_id">
									<image name="plus" src="https://jw.xzsw2021.com/static/client/icon_84@2x.png"
										mode=""></image>
								</rules>
							</view>



							<!-- <my-numberBox :index="index" :info="item.num"></my-numberBox> -->
							<!-- 	<u-number-box :value="item.num" @change="onChange">
								
								<view slot="minus" class="minus">
									<image name="minus" src="https://jw.xzsw2021.com/static/client/icon_83@2x.png" mode=""></image>
								</view>
								<text slot="input" style="width: 50rpx;text-align: center;font-weight: bold;"
									class="input2">{{item.num}}</text>
								
								<view slot="plus" class="plus">
									<image name="plus" src="https://jw.xzsw2021.com/static/client/icon_84@2x.png" mode=""></image>
								</view>
							</u-number-box> -->
						</view>
					</view>
					<!-- 商品图标 -->
					<view class="shop-tag">
						<image :src="item.shop_img" mode=""></image>
					</view>
					<!-- 精选好物 -->
					<view class="shop-good" v-if="item.good">
						<image :src="item.good" mode=""></image>
					</view>
					<!-- 最近浏览过 -->
					<view class="shop-history c3 f22" v-if="item.desc">{{item.desc}}</view>
					<!-- 长按遮罩 -->
					<view class="shop-xiangsi" v-if="item.isShow" @click.stop="cancelMask(index)">
						<view class="shop-xs2 fw-ct" @click="goXs(item)">
							<image src="https://jw.xzsw2021.com/static/index/icon_32@2x.png" mode=""></image>
							<text>找相似</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 红包弹窗 -->
		<uni-popup ref="popup" type="center" :isMaskClick="false">
			<view class="pop">
				<view class="p1-img">
					<image src="https://jw.xzsw2021.com/static/index/bt@2x.png" mode=""></image>
				</view>
				<!-- 红包 -->
				<view class="p1-hb">
					<!-- 背景 -->
					<view class="hb-img">
						<image src="https://jw.xzsw2021.com/static/index/hb@2x.png" mode=""></image>
					</view>
					<!-- 金额 -->
					<view class="p1-price fw-ct">
						<view class="bold f132 tr">999</view>
						<view class="bold f44">元</view>
					</view>
					<!-- 使用 -->
					<view class="pbtn1" @click="useHb"></view>
				</view>
				<!-- 关闭 -->
				<view class="p1-close f-w" @click="close1">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
			</view>
		</uni-popup>
		<!-- 红包弹窗结束 -->
		<!-- 限时抢购开始 -->
		<uni-popup ref="popup2" type="center" :isMaskClick="false">
			<view class="pop2">
				<!-- 商品内容 -->
				<view class="pcontent2">
					<!-- 背景 -->
					<view class="img">
						<image src="https://jw.xzsw2021.com/static/index/icon_20@2x.png" mode=""></image>
					</view>
					<!-- 商品内容 -->
					<view class="list">
						<view class="msg flex" v-for="(item,index) of xsqg" :key="index" @click="goXsShop(item.id)">
							<!-- 背景 -->
							<view class="bg">
								<image src="https://jw.xzsw2021.com/static/index/icon_22@2x.png" mode=""></image>
								<!-- 商品类型 -->
								<view class="type">{{item.type}}</view>
							</view>
							<view class="shop-img">
								<image src="https://jw.xzsw2021.com/static/index/icon_34@2x.png" mode=""></image>
							</view>
							<view class="shop-right">
								<view class="f24">{{item.desc}}</view>
								<view class="f-w two">
									<view class="f32">￥{{item.price}}</view>
									<!-- 原价或许没有 -->
									<view class="f22 old" v-if="item.old_price">￥{{item.old_price}}</view>
									<view class="go">
										<image src="https://jw.xzsw2021.com/static/index/icon_23@2x.png" mode="">
										</image>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 关闭 -->
				<view class="p2-close f-w" @click="close2">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
			</view>
		</uni-popup>
		<!-- 限时抢购结束 -->
		<!-- 调查问卷开始 -->
		<uni-popup ref="popup3" type="center" :isMaskClick="false">
			<view class="pop3">
				<!-- 调查问卷 -->
				<view class="pbox">
					<view class="bg">
						<image src="https://jw.xzsw2021.com/static/index/icon_24@2x.png" mode=""></image>
					</view>
					<!-- 立即填写 -->
					<view class="pbtn3" @click="goTx">
						立即填写
					</view>
				</view>
				<!-- 关闭 -->
				<view class="p2-close f-w" @click="close3">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
			</view>
		</uni-popup>

		<!-- 广告 -->
		<uni-popup ref="popup4" type="center" :isMaskClick="false">
			<view class="pop3">
				<!-- 调查问卷 -->
				<view class="pbox">
					<view class="bg">
						<image :src="popData.pic" mode=""></image>
					</view>
					<!-- 立即填写 -->
					<view class="pbtn3" @click="goPop">
						<view v-if="popData.type == 4">
							立即填写
						</view>
						<view v-else>
							去领取
						</view>
					</view>
				</view>
				<!-- 关闭 -->
				<view class="p2-close f-w" @click="close4">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
					<!-- <image :src="popData.pic" mode=""></image> -->
				</view>
			</view>
		</uni-popup>

		<!-- 调查问卷结束 -->
		<!-- 红包 -->
		<hongbao></hongbao>
		<!-- 客服 -->
		<view class="kfbox" @click="goKefu">
			<image src="https://jw.xzsw2021.com/static/index/icon_53@2x.png" mode=""></image>
		</view>
		<!-- <kefu></kefu> -->
		<!-- 购物车 -->
		<!-- <cart></cart> -->
	</view>
</template>

<script>
	import hongbao from '@/components/hongbao.vue';
	import kefu from '@/components/kefu.vue';
	import cart from '@/components/cart.vue'
	import rules from '@/components/rules.vue'
	import Cache from '@/util/cache.js'
	import {
		getSecKillTimeApi,
		getSecKillProductListApi,
		getUserProductVisitApi
	} from '@/api/product.js'
	import {
		getUrlParams
	} from '@/api/public.js'
	import {
		getAdvertisementApi,
		getUserNewsNumApi,
		userReceiveGiveRedApi,
		userGetShareCard
	} from '@/api/user.js'

	export default {
		components: {
			hongbao,
			kefu,
			rules,
			cart
		},
		data() {
			return {
				home: {},
				hot: [],
				noticeS: [],
				noticeData: [],
				title: 'Hello',
				isShow: false, //遮罩层显示
				time: 0, //倒计时时间
				rate: 3.6, //评分
				position: "",
				active1: 0, //附近商家默认
				serveUrl: '', //服务器地址
				show: false, //菜市场列表下拉选择器
				ad: '',
				columns: [], //菜市场列表
				myshop: '', //mar_id
				bannerList: [], //
				NoticeList: [{
						id: 1,
						title: '平台公告'
					},
					{
						id: 1,
						title: '平台公告平台公告平台公告平台公告平台公告平台公告平台公告平台公告平台公告'
					}
				], //
				list2: [{}], //
				nameList: [{
						id: 1,
						title: '综合排序'
					},
					{
						id: 2,
						title: '销量最高'
					},
					{
						id: 3,
						title: '商家好评'
					},
				], //
				shopList: [], //商品列表
				isMore: true, //
				marketlist: [], //商家列表
				killProductList: [], //秒杀商品
				secKill: [], //秒杀时间段
				xsqg: [{
						id: '1',
						type: '时令蔬菜',
						img: '',
						desc: '限时促销，立即抢购',
						price: '69.9',
						old_price: '99'
					},
					{
						id: '2',
						type: '水产海鲜',
						img: '',
						desc: '限时促销，立即抢购',
						price: '69.9',
					}
				], //限时抢购商品列表
				goodsList2: [], //
				page: 1,
				killTimeObj: {
					seckillEndCountdown: 0
				},
				visitProudctList: [], //推荐商品
				popData: {},
				newsNum: 0, //消息数量
			}
		},
		computed: {


		},
		onLoad(e) {
			if (e.spid) {
				Cache.set('spid', e.spid)
				Cache.set('spread_spid', e.spid)
			}
			if (e.spread_spid) {
				Cache.set('spread_spid', e.spread_spid)
			}
			if (e.userRedxxx) { //普通红包赠送 。没页面就在首页领取了
				Cache.set('userRedxxx', e)
			}
			if (e.card_share) { //礼品卡分享。缺少页面，首页领取得了
				Cache.set('userGetShareCard', e)
			}
			if (e.scene) { //扫码邀请
				let value = getUrlParams(decodeURIComponent(e.scene));
				Cache.set('spread_spid', Number(value.spid))
				if (value.id) { //商品详情
					let url = `/pages/client/shop/shop-detail/shop-detail?id=${value.id}`
					uni.switchTab({
						url: url,
						fail: (err) => {
							uni.navigateTo({
								url: url
							})
						}
					})
				}
			}
			console.log(e, '=====================')
			this.init()
			if (!Cache.get('market')) {
				this.getAddress().then(res => {
					// 需要获取定位之后调取的接口 优先以默认收货地址推荐菜市场
					this.$request('market/lst', this.position, 'GET').then(res => {
						this.columns = [res.data]
						this.myshop = res.data[0]
					})
				}).catch(err => {})
			} else {

				this.myshop = JSON.parse(Cache.get('market'))
			}


			// this.gettm()
		},
		onShareAppMessage() {

		},
		onShow() {
			this.advertisement()
			getUserNewsNumApi().then(res => {
				this.newsNum = res.data.count
			}).catch(err => {

			})
			if (Cache.get('userRedxxx')) { //领取红包
				userReceiveGiveRedApi(JSON.parse(Cache.get('userRedxxx'))).then(res => {
					Cache.clear('userRedxxx')
					uni.showToast({
						title: res.message,
						icon: "none"
					})
				}).catch(err => {
					uni.showToast({
						title: err.message,
						icon: "none"
					})
					Cache.clear('userRedxxx')
				})
			}
			if (Cache.get('userGetShareCard')) { //用户领取分享赠送的礼品卡
				let e = JSON.parse(Cache.get('userGetShareCard'))
				userGetShareCard(e).then(res => {
					Cache.clear('userGetShareCard')
					uni.showToast({
						title: res.message,
						icon: "none"
					})
				}).catch(err => {
					Cache.clear('userGetShareCard')
					uni.showToast({
						title: err.message,
						icon: "none"
					})
				})

			}


		},
		onReachBottom() {
			this.getgoods(this.page + 1)
		},
		mounted() {
			this.page = 1
			console.log(this.myshop, 'mar_id')
			this.gethome()
			this.getKillTime()
			this.secKillProduct()
			this.userVisitProudct()
			this.notice_S()
		},
		watch: {
			myshop(e) {
				this.page = 1
				this.getmerchart()
				this.getKillTime()
				this.getgoods(this.page)
				// uni.setStorageSync('market', this.myshop)
				Cache.set('market', this.myshop)
				this.secKillProduct()
				this.userVisitProudct()
			},
		},
		methods: {
			// 企业客服
			goKefu() {

				wx.openCustomerServiceChat({
					extInfo: {
						url: 'https://work.weixin.qq.com/kfid/kfc6f994467310b0469'
					},
					corpId: 'ww039cffd06bc622cd',
					success(res) {
						console.log('成功', res)
					},
					fail(err) {
						console.log('失败', err)
					}
				})
			},
			notice_S() {
				let This = this
				this.$request.get('article/category/lst').then(res => {
					let article_category_id = 0
					res.data.forEach(notClass => {
						if (notClass.title == '平台公告') {
							console.log(notClass)
							article_category_id = notClass.article_category_id
						}
					})
					return This.$request.get(`article/lst/${article_category_id}`)
				}).then(res => {
					console.log(res, "????????")
					This.noticeData = res.data.list
					res.data.list.forEach(article => {
						This.noticeS.push(article.title)
					})
				}).catch(err => {
					console.log(err, "0000000000000000")
				})
			},
			userVisitProudct() {
				getUserProductVisitApi({
					mar_id: this.myshop.id
				}).then(res => {
					this.visitProudctList = res.data.product
				})
			},
			close4() {
				this.$refs.popup4.close()
			},
			goPop() {
				this.close4()
				let url = ''
				switch (this.popData.type) {
					case 4: //弹窗问卷调查
						url = `/pages/client/question/question?id=${this.popData.pid}`
						break;
					case 2: //商品
						url = `/pages/client/shop/shop-detail/shop-detail?id=${this.popData.pid}&type=0`
						break;
					case 1: //红包
						url = `/pages/user/myredbao/redbao-center/redbao-center`
						break;
					default:
						url = `/${this.popData.link}`
				}
				uni.switchTab({
					url: url,
					fail: (err) => {
						uni.navigateTo({
							url: url
						})
					}
				})
			},
			/**
			 * 弹窗
			 */
			advertisement() {
				let This = this
				getAdvertisementApi().then(res => {
					let data = false
					try {
						res.data.forEach(item => {
							if (!Cache.get(`home:pop:${item.id}`)) {
								Cache.set(`home:pop:${item.id}`, 1, 3600 * 24)
								data = item
								throw new Error('LoopInterrupt');
							}
						})
					} catch (e) {

					}
					if (data != false) {
						if (data.type == 4) {
							this.$request('questionnaire/list', {
								page: 1,
								is_new: 1,
								limit: 200
							}, 'GET').then(res => {
								res.data.forEach(item => {
									if (item.group_data_id == data.pid) {
										let isShow = Cache.get(
											`questionnaire:${res.data[0].group_data_id}`)
										if (!isShow) {
											Cache.set(`questionnaire:${res.data[0].group_data_id}`,
												1,
												604800)
											This.popData = data
											This.$refs.popup4.open()
										}
									}
								})

							})
						} else {
							This.popData = data
							This.$refs.popup4.open()
						}
					}
				}).catch(err => {

				})
			},


			/**
			 * 获取秒杀秒杀商品
			 */
			secKillProduct() {
				getSecKillProductListApi({
					page: 1,
					limit: 2,
					type: 1,
					mar_id: this.myshop.id
				}).then(res => {
					console.log(res, 'kill product')
					this.killProductList = res.data.list
				}).catch(err => {

				})
			},
			/**
			 * 获取平台秒杀时间段
			 */
			getKillTime() {
				getSecKillTimeApi().then(res => {
					this.killTimeObj = res.data
					this.killTimeObj.seckillEndCountdown =
						Math.ceil(res.data.seckillEndTime * 1000 - (new Date()).getTime())
				}).catch(err => {})
			},
			/**
			 * 问卷调查
			 */
			gettm() {
				this.$request('questionnaire/list', {
					page: 1,
					is_new: 1,
					limit: 200
				}, 'GET').then(res => {
					if (res.data.length > 0) {
						let isHide = Cache.get(`questionnaire:${res.data[0].group_data_id}`)
						if (isHide != 1) {
							Cache.set(`questionnaire:${res.data[0].group_data_id}`, 1, 604800) //7天不展示相同的问卷调查
							this.$refs.popup3.open()
						}
					}
				})
			},
			gochooseadd() {
				uni.navigateTo({
					url: "/pages/client/address-choose/address-choose?kind=1"
				})
			},
			/**
			 * 根据菜市场id获取商家列表
			 */
			getmerchart() {
				this.$request('store/merchant/lst', {
					mar_id: this.myshop.id,
					limit: 2,
					order: this.active1 == '0' ? 'rate' : this.active1 == '1' ? '' : 'delivery'
				}, 'GET').then(res => {
					let arr = []
					res.data.list.forEach(async (item) => {
						item.lat = item.lat ? item.lat : this.myshop.latitude
						item.long = item.long ? item.long : this.myshop.longitude
						console.log(this.position, 'this.positionthis.position')
						if (typeof this.position === 'object') {
							let res2 = await this.countkm(this.position.lat, this.position.lng,
								item.lat *
								1, item.long * 1)
							console.log(res2)
							if (typeof res2.data != 'undefined') {
								item.km = (res2.data.paths[0].distance / 1000).toFixed(2)
								item.time = parseInt(res2.data.paths[0].duration / 60)
							} else {
								item.km = ''
								item.time = ''
							}
						} else {
							item.km = ''
							item.time = ''
						}
						arr.push(item)
					})
					this.marketlist = arr
				})
			},
			// 根据经纬度计算距离12321
			countkm(lat1, lng1, lat2, lng2) {
				// console.log(`https://restapi.amap.com/v4/direction/bicycling?origin=${lng1},${lat1}&destination=${lng2},${lat2}&key=c858b6921758e3f3400070929386564c`,)
				// return;
				return new Promise((resolve, reject) => {
					uni.request({
						url: `https://restapi.amap.com/v4/direction/bicycling?origin=${lng1},${lat1}&destination=${lng2},${lat2}&key=c858b6921758e3f3400070929386564c`,
					}).then((response) => {
						let [error, res] = response;
						resolve(res.data);
					}).catch(error => {
						let [err, res] = error;
						reject(err)
					});
				})
			},
			/**
			 * 根据菜市场id获取商品	
			 * @param {Object} e
			 */
			getgoods(e) {
				let data = {
					mar_id: this.myshop.id,
					page: e,
					product_type: 0,
					...this.position
				}
				// this.$request('product/spu/recommend', data, 'GET').then(res => {
				this.$request('product/spu/lst', data, 'GET').then(res => {
					res.data.list.forEach(item => {
						item.isShow = false
						item.num = 0
					})
					if (e == 1) {
						this.shopList = res.data.list
					} else {
						if (res.data.list.length == 0) {
							uni.showToast({
								title: "暂无更多",
								icon: "none"
							})
							return
						}
						let list = this.shopList
						list = [...list, ...res.data.list]
						this.shopList = list
						this.page = e
					}

				})
			},
			/**
			 * 首页接口
			 */
			gethome() {
				this.$request('common/home', {}, 'GET').then(res => {
					this.bannerList = res.data.banner
					this.hot = res.data.hot
					this.goodsList2 = this.$group(res.data.menu, 10);
					this.ad = res.data.ad
					this.home = res.data
				})
			},
			init() {
				this.$request('config', {}, 'GET').then(res => {
					console.log('config', res.data)
					uni.setStorageSync('init', res.data)
				})
			},
			// 获取当前地理位置
			getAddress() {
				let that = this
				return new Promise((resolve, reject) => {
					uni.getLocation({
						type: 'wgs84',
						success: function(res) {
							let obj = {
								lng: res.longitude,
								lat: res.latitude
							}
							that.position = obj

							resolve(obj)
						},
						fail(err) {
							reject(err)
						}
					});
				})
			},
			// 选择地址
			chooseAddress() {
				uni.chooseLocation({
					success: function(res) {
						console.log('位置名称：' + res.name);
						console.log('详细地址：' + res.address);
						console.log('纬度：' + res.latitude);
						console.log('经度：' + res.longitude);
					}
				})
			},
			// 确认切换店铺
			sureShop(e) {
				this.show = false;
				this.myshop = e.value[0]
				this.$forceUpdate()
				// 发送切换店铺，需要改变的接口
			},
			// 消息、/活动
			goNotify() {
				uni.navigateTo({
					url: '/pages/client/notice/notice'
				})
			},
			// 轮播图跳转
			goUrl(index) {

				let url = this.bannerList[index].url;
				if (url == '/pages/index/index' || url == '/pages/state/state' || url == '/pages/cart/cart' || url ==
					'/pages/live/live' || url == '/pages/user/user') {
					uni.switchTab({
						url
					})
				} else {
					uni.navigateTo({
						url
					})
				}
			},
			// 菜单跳转
			goUrl2(url) {
				console.log(url ,url.length ,'url............')
				if (url == '/pages/index/index' || url.includes('pages/goods/goods') || url == '/pages/state/state' ||
					url == '/pages/cart/cart' || url ==
					'/pages/live/live' || url == '/pages/user/user') {
					if (url.includes('pages/goods/goods')) {
						var loc = url
						var n1 = loc.length; //地址的总长度
						var n2 = loc.indexOf("="); //取得=号的位置
						var id = loc.substr(n2 + 1, n1 - n2); //从=号后面的内容
						console.log(id,'/////////////////')
						uni.setStorageSync('switchid', id)

					}

					uni.switchTab({
						url
					})

				} else {
					if (url.includes('shop-list')) {
						let myshop = this.myshop
						uni.navigateTo({
							url: '/pages/client/shop-list/shop-list?myshop=' + JSON.stringify(myshop)
						})
					} else {
						uni.navigateTo({
							url
						})
					}

				}
			},
			// 公告
			goNotice(index) {
				console.log(index)
				let data = this.noticeData[index]
				console.log('通知');
				uni.navigateTo({
					url: '/pages/client/gonggao-list/gonggao-list'
					// url: `/pages/client/gonggao-list/gonggao-list/?id=${data.article_id}`
				})
			},
			// 去搜索
			goSearch() {
				uni.navigateTo({
					url: '/pages/client/search/search?id=' + this.myshop.id
				})
			},
			// 更多商家
			goShopList() {
				let myshop = this.myshop
				uni.navigateTo({
					url: '/pages/client/shop-list/shop-list?myshop=' + JSON.stringify(myshop)
				})
			},
			// 附近商家切换类型
			checkType(index) {
				this.active1 = index;
				this.getmerchart()
			},
			// 去店铺
			goShop(id) {
				uni.navigateTo({
					url: '/pages/client/shop/shop?id=' + id
				})
			},
			// 去今日秒杀
			goSkill() {
				console.log('asdfasdfsa')
				uni.navigateTo({
					url: '/pages/client/skill/skill?type=1'
				})
			},
			// 倒计时监听
			changeTime(time) {

				console.log('结束');
			},
			// 加入购物车
			addcart(id, unique, type) {
				uni.showLoading({
					mask: true
				})
				let data = {
					cart_num: 1,
					is_new: 0,
					product_attr_unique: unique,
					product_id: id,
					product_type: type
				}
				this.$request('user/cart/create', data).then(res => {
					if (res.status == 200) {
						uni.showToast({
							title: "添加成功"
						})
					}
				})
			},
			// 去商品详情
			goShopDetail(item) {
				console.log(item)
				uni.navigateTo({
					url: `/pages/client/shop/shop-detail/shop-detail?id=${item.product_id}&type=${item.product_type}`
				})
			},
			// 长按找相似
			goXiangsi(id, index) {
				this.shopList[index].isShow = true;
			},
			//取消遮罩层
			cancelMask(index) {
				this.shopList[index].isShow = false;
			},
			// 去相似
			goXs(item) {
				console.log(item)
				// console.log('去相似页面', this.shopList[index].id);
				uni.navigateTo({
					url: '/pages/client/smilar/smilar?cate_id=' + item.cate_id
				})
			},
			// 加入购物车-切换值
			onChange(e) {
				console.log('值', e);
			},
			// 商品券兑换
			goDuihuan(index, index2) {
				let list = this.hot
				let item = list[index]
				if (item.s_type == 1) {
					this.goUrl2(item.url)
				} else {
					let id = item.url
					let title = item.title
					let s_title = item.s_title
					uni.navigateTo({
						url: "/pages/client/stock/stock?id=" + JSON.stringify(id) + '&title=' + title +
							'&s_title=' + s_title
					})
					console.log(id)
					// uni.navigateTo({
					// 	url: "/pages/client/shop/shop-detail/shop-detail?id=" + id
					// })
				}

			},
			// 红包弹窗关闭
			close1() {
				this.$refs.popup.close();
			},
			// 使用红包
			useHb() {
				console.log('使用红包');
				this.$refs.popup.close();
			},
			// 限时抢购关闭
			close2() {
				this.$refs.popup2.close();
			},
			// 限时抢购-go
			goXsShop(id) {
				this.$refs.popup2.close();
				console.log('去抢购商品', id);
			},
			// 问卷调查-立即填写
			goTx() {
				this.$refs.popup3.close();
				uni.navigateTo({
					url: '/pages/client/question/question?index=0'
				})
				console.log('立即填写');
			},
			// 问卷调查-关闭
			close3() {
				this.$refs.popup3.close();
			},

		}
	}
</script>

<style>
	page {
		background-color: #f3f3f3;
	}

	.fnustitle>text:nth-of-type(1) {
		font-size: 30rpx;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #333333;
	}

	.fnustitle>text:nth-of-type(2) {
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		margin-left: 10rpx;
	}

	.fnusimg {
		display: flex;
		align-items: center;
		justify-content: space-around;
	}

	.fnusimg image {
		flex: 1;
	}
</style>
<style lang="scss">
	.kfbox {
		position: fixed;
		right: 0rpx;
		bottom: 62rpx;
		width: 133rpx;
		height: 133rpx;
		z-index: 21;
	}

	.kfbox image {
		width: 133rpx;
		height: 133rpx;
	}

	.rightmore {
		width: 400rpx;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		font-size: 30rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #333333;

	}

	/* #ifdef MP-WEIXIN */
	wx-swiper .wx-swiper-dot {
		width: 10rpx;
		height: 10rpx;
		background: #999999;
		border-radius: 50%;
	}

	wx-swiper .wx-swiper-dot-active {
		width: 20rpx;
		height: 10rpx;
		background: #27B18B;
		border-radius: 5rpx;
	}

	/* #endif */

	.myimg {
		width: 100%;
		height: 100%;
	}

	.shop-btn {
		width: 40rpx;
		height: 40rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.box {
		&>view {
			padding: 0 20rpx;
		}

		.c1 {
			color: #109C7A;
			font-weight: bold;
		}

		.c2 {
			color: #FCA223;
		}

		.c3 {
			color: #F45E14;
		}

		.box1 {
			overflow: hidden;
			background: linear-gradient(180deg, #109C7A 0%, rgba(16, 156, 122, 0) 100%);

			// 
			.title1 {
				margin: 16rpx auto 16rpx;
				color: #fff;
				font-size: 30rpx;

				.address {
					.img {
						margin-right: 10rpx;
						width: 30rpx;
						height: 36rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}

				.notify {
					margin-right: 10rpx;

					.img {
						position: relative;
						width: 30rpx;
						height: 36rpx;

						image {
							width: 100%;
							height: 100%;
						}

						.jiaobiao {
							position: absolute;
							top: -10rpx;
							right: -10rpx;
							width: 26rpx;
							height: 26rpx;
							line-height: 26rpx;
							text-align: center;
							font-size: 16rpx;
							border-radius: 50%;
							background-color: #FA5151;
							color: #fff;
						}
					}
				}
			}

			// 搜索
			.search {

				width: 710rpx;
				height: 68rpx;
				background: #F3F3F3;
				border-radius: 34rpx;

				.img {
					margin: 0 15rpx 0 25rpx;
					width: 30rpx;
					height: 30rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.input {
					font-size: 26rpx;
				}
			}

			// 轮播图
			.swiper {
				margin-top: 19rpx;
				border-radius: 10rpx;
				overflow: hidden;

				image {
					border-radius: 10rpx;
				}
			}

			// 消息通知
			.notice {
				margin-top: 16rpx;
				padding: 16rpx;
				max-height: 66rpx;
				background-color: #FDDAC9;
				border-radius: 20rpx;
				box-sizing: border-box;

				image {
					margin: 2rpx;
					margin-right: 12rpx;
					width: 30rpx;
					height: 30rpx;
				}

				.text {
					flex: 1;
					font-size: 22rpx;
					letter-spacing: 2rpx;
					color: #666;

					.swiper {
						margin-top: 0;
						height: 30rpx;
					}
				}
			}

			// 商品分类
			.goods {
				margin-top: 17rpx;
				width: 710rpx;
				height: 378rpx;
				padding-bottom: 20rpx;
				background: #fff;
				background-color: rgba(255, 255, 255, .5);
				border-radius: 20rpx;
				color: #333;

				.goods-swiper {
					height: 406rpx;

				}

				.swiper-item {
					flex-wrap: wrap;
					padding: 20rpx 0;

					&>view:nth-child(5n-4) {
						margin-left: 15rpx;

					}

					.goods-demo {
						flex-shrink: 0;
						width: 120rpx;
						margin: 0 8rpx;
						margin-bottom: 30rpx;
						text-align: center;
						overflow: hidden;
						box-sizing: border-box;

						// border: 1rpx solid #000;
						.goods-img {
							display: inline-block;
							width: 110rpx;
							height: 110rpx;

							image {
								width: 100%;
								height: 100%;
								border-radius: 50%;
								vertical-align: middle;
							}
						}

						.goods-name {
							margin-top: 15rpx;
							font-size: 24rpx;
							white-space: nowrap;
						}
					}
				}
			}
		}

		.card {
			margin: 0 auto;
			width: 710rpx;
			padding: 18rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			box-sizing: border-box;
		}

		// 附近商家
		.shopping {
			margin-top: 16rpx;
			padding: 20rpx 12rpx;

			.title {
				padding-top: 10rpx;

				.more {
					width: 146rpx;
					height: 45rpx;
					line-height: 45rpx;
					text-align: center;
					border-radius: 24rpx;
					background-color: #4cc7a6;
					box-shadow: 0rpx 1rpx -2rpx #3dc39e;
					color: #fff;
					font-size: 24rpx;

					image {
						margin-left: 14rpx;
						width: 8rpx;
						height: 12rpx;
					}
				}
			}

			.title2 {
				margin-top: 24rpx;
				font-size: 26rpx;
				color: #999;

				&>view {
					margin-right: 50rpx;
				}
			}

			.shop {
				margin-top: 32rpx;

				&>view {
					width: 686rpx;
					height: 160rpx;
					padding: 20rpx;
					box-sizing: border-box;
					background: linear-gradient(0deg, #F5FDFB 0%, #EBFCF8 100%);
					border-radius: 20rpx;

					.shop-img {
						width: 120rpx;
						height: 120rpx;

						image {
							width: 100%;
							height: 100%;
							border-radius: 12rpx;
						}
					}

					.shop-right {
						margin-left: 14rpx;
						flex: 1;

						.tag {
							padding: 2rpx 6rpx;
							background: #0CA01D;
							border-radius: 4rpx;
							color: #fff;
						}

						.shop-two,
						.shop-three {
							color: #666;
							font-size: 24rpx;
						}

						.shop-two {
							.time {
								margin-right: 20rpx;
							}
						}

						.num {
							margin-left: 20rpx;
						}

						.line {
							margin: 0 10rpx;
							width: 1rpx;
							height: 20rpx;
							background-color: #e0e0e0;
						}
					}
				}

				&>view:first-child {
					margin-bottom: 16rpx;
				}
			}
		}

		// 今日秒杀
		.skill {
			margin-top: 20rpx;
			padding: 30rpx 16rpx;

			.skill-title {
				.countdown {
					margin-left: 16rpx;
					margin-top: 2rpx;
					padding: 6rpx 12rpx;
					color: #fff;
					background: linear-gradient(90deg, #08B889 0%, #4CC7A6 100%);
					border-radius: 16rpx;

					.countdown-img {
						margin-right: 6rpx;
						width: 23rpx;
						height: 22rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					// 
					.u-count-down__text {
						color: #fff;
						font-size: 22rpx;
						line-height: 22rpx;
					}

				}
			}

			.skill-shops {
				margin-top: 36rpx;
				padding: 0 80rpx;

				.skill-shop {
					text-align: center;

					.skill-shop-img {
						width: 160rpx;
						height: 160rpx;

						image {
							width: 100%;
							height: 100%;
						}

						margin-bottom: 10rpx;
					}

					.skill-shop-price {
						// margin-top: 20rpx;
						padding: 2rpx 16rpx;
						color: #fff;
						text-align: center;
						background: linear-gradient(142deg, #FA925E 0%, #F83A4A 100%);
						border-radius: 20rpx;
					}
				}
			}
		}

		// 功能块儿
		.funs {
			margin: 20rpx;
			padding: 30rpx 16rpx 30rpx;
			flex-wrap: wrap;

			.funs-img {
				width: 295rpx;
				height: 193rpx;


			}

			&>view:nth-child(1) {
				padding: 0 40rpx 70rpx 0;
				border-right: 1rpx solid #E1FAF3;
				border-bottom: 1rpx solid #E1FAF3;
			}

			&>view:nth-child(2) {
				padding: 0 0 70rpx 27rpx;

			}

			&>view:nth-child(3) {
				padding: 32rpx 40rpx 25rpx 0;

			}

			&>view:nth-child(4) {
				padding: 32rpx 0 25rpx 27rpx;
				border-top: 1rpx solid #E1FAF3;
				border-left: 1rpx solid #E1FAF3;
			}
		}

		// 最近常卖/广告栏
		.funs2 {
			&>view {
				width: 345rpx;
			}

			.zj-img {
				width: 345rpx;
				height: 568rpx;

				image {
					width: 100%;
					height: 100%;
				}

				video {
					width: 100%;
					height: 100%;
					border-radius: 20rpx;
				}
			}

			.shop-demo {
				width: 344rpx;
				min-height: 568rpx;
				border-radius: 20rpx;

				.shop-demo-swiper {
					min-height: 568rpx;
					overflow: hidden;
					box-sizing: border-box;
					border-radius: 20rpx;
				}

				.shop-demo2 {
					position: relative;
					margin-bottom: 20rpx;
					width: 344rpx;
					padding: 55rpx 26rpx 40rpx;
					min-height: 568rpx;
					background: #FFFFFF;
					border-radius: 20rpx;
					box-sizing: border-box;

					.shop-img {
						width: 284rpx;
						height: 284rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.shop-name {
						margin: 20rpx 0 10rpx;
					}

					.shop-name2 {
						height: 64rpx;
						font-size: 24rpx;
						color: #666;
					}

					.shop-price {
						// margin-top: 28rpx;
					}

					.shop-tag {
						position: absolute;
						top: 16rpx;
						left: 16rpx;
						width: 60rpx;
						height: 60rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.shop-good {
						position: absolute;
						top: 0;
						right: 16rpx;
						width: 53rpx;
						height: 71rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.shop-history {
						position: absolute;
						top: 12rpx;
						left: 50%;
						transform: translateX(-50%);
						width: 180rpx;
						text-align: center;
						white-space: nowrap;
						overflow: hidden;
					}

					// 相似
					.shop-xiangsi {
						position: absolute;
						top: 0;
						left: 0;
						width: 344rpx;
						min-height: 568rpx;
						border-radius: 20rpx;
						background-color: rgba(0, 0, 0, .5);
						z-index: 3;

						.shop-xs2 {
							margin: 250rpx auto;
							width: 280rpx;
							height: 68rpx;
							line-height: 68rpx;
							background: #F3F3F3;
							border-radius: 34rpx;
							text-align: center;
							color: #109C7A;
							font-size: 26rpx;

							image {
								margin-right: 12rpx;
								width: 30rpx;
								height: 30rpx;
							}
						}
					}
				}
			}
		}

		.funs2-title {
			margin-bottom: 20rpx;

		}

		.funs2-img-tag {
			margin-right: 10rpx;
			width: 6rpx;
			height: 26rpx;
			background: #27B18B;
			border-radius: 3rpx;
		}

		// 商品
		.list {
			margin-top: 30rpx;

			.list2 {
				flex-wrap: wrap;
				overflow: hidden;

				&>view {
					position: relative;
					margin-bottom: 20rpx;
					width: 344rpx;
					padding: 55rpx 26rpx 40rpx;
					min-height: 568rpx;
					background: #FFFFFF;
					border-radius: 20rpx;
					box-sizing: border-box;

					.shop-img {
						width: 284rpx;
						height: 284rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.shop-name {
						margin: 20rpx 0 10rpx;
					}

					.shop-name2 {
						height: 64rpx;
						font-size: 24rpx;
						color: #666;
					}

					.shop-price {
						// margin-top: 28rpx;
					}

					.shop-tag {
						position: absolute;
						top: 16rpx;
						left: 16rpx;
						width: 60rpx;
						height: 60rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.shop-good {
						position: absolute;
						top: 0;
						right: 16rpx;
						width: 53rpx;
						height: 71rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.shop-history {
						position: absolute;
						top: 12rpx;
						left: 50%;
						transform: translateX(-50%);
						width: 180rpx;
						text-align: center;
						white-space: nowrap;
						overflow: hidden;
					}

					// 相似
					.shop-xiangsi {
						position: absolute;
						top: 0;
						left: 0;
						width: 344rpx;
						min-height: 568rpx;
						border-radius: 20rpx;
						background-color: rgba(0, 0, 0, .5);
						z-index: 3;

						.shop-xs2 {
							margin: 250rpx auto;
							width: 280rpx;
							height: 68rpx;
							line-height: 68rpx;
							background: #F3F3F3;
							border-radius: 34rpx;
							text-align: center;
							color: #109C7A;
							font-size: 26rpx;

							image {
								margin-right: 12rpx;
								width: 30rpx;
								height: 30rpx;
							}
						}
					}
				}
			}
		}

		// 红包弹窗
		.pop {
			width: 700rpx;
			height: 800rpx;

			.p1-img {
				width: 641rpx;
				height: 141rpx;
				margin: 0 auto;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.p1-hb {
				position: relative;
				margin: 0 auto;
				width: 462rpx;

				.hb-img {
					width: 462rpx;
					height: 561rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.p1-price {
					position: absolute;
					left: 0;
					top: 80rpx;
					width: 462rpx;
					height: 135rpx;
					color: #EE1F0C;
					align-items: flex-end;

					.f132 {
						line-height: 118rpx;
						margin-right: 10rpx;
					}
				}

				.pbtn1 {
					position: absolute;
					left: 52rpx;
					bottom: 55rpx;
					width: 350rpx;
					height: 90rpx;
					border-radius: 50rpx;
				}
			}

			.p1-close {
				width: 58rpx;
				height: 58rpx;
				margin: 20rpx auto 0;

				image {
					@extend .myimg;
				}
			}
		}

		// 限时抢购弹窗
		.pop2 {
			position: relative;
			width: 594rpx;

			.pcontent2 {
				width: 594rpx;
				height: 614rpx;

				.img {
					width: 594rpx;
					height: 614rpx;

					image {
						@extend .myimg;
					}
				}

				.list {
					position: absolute;
					left: 48rpx;
					top: 180rpx;
					width: 498rpx;
					height: 340rpx;
					overflow: hidden;
					overflow-y: auto;
					border-radius: 12rpx;

					&>view:not(:last-child) {
						margin-bottom: 20rpx;
					}

					.msg {
						position: relative;
						width: 498rpx;
						height: 161rpx;
						padding: 20rpx 15rpx;
						background: #FEFEFE;
						border-radius: 12rpx;
						box-sizing: border-box;

						.bg {
							position: absolute;
							width: 198rpx;
							height: 54rpx;
							left: 50%;
							transform: translateX(-50%);
							top: -2rpx;

							image {
								@extend .myimg;
							}

							.type {
								left: 0;
								top: 0;
								position: absolute;
								width: 198rpx;
								height: 54rpx;
								line-height: 48rpx;
								text-align: center;
								font-size: 32rpx;
								color: #fff;
								z-index: 3;
							}
						}

						.shop-img {
							width: 147rpx;
							height: 117rpx;

							image {
								@extend .myimg;
							}
						}

						.shop-right {
							padding-top: 40rpx;
							flex: 1;
							margin-left: 34rpx;
							color: #EC6557;

							.two {
								position: relative;
								margin-top: 10rpx;
								align-items: flex-end;

								.old {
									margin-left: 12rpx;
									color: #BCBDBD;
									text-decoration: line-through;
								}

								.go {
									position: absolute;
									right: 20rpx;
									bottom: 0;
									width: 77rpx;
									height: 33rpx;

									image {
										@extend .myimg;
									}
								}
							}
						}
					}
				}
			}

			.p2-close {
				width: 58rpx;
				height: 58rpx;
				margin: 20rpx auto 0;

				image {
					@extend .myimg;
				}
			}

		}

		// 问卷调查
		.pop3 {
			width: 485rpx;
			min-height: 650rpx;

			.pbox {
				width: 485rpx;
				height: 588rpx;
				position: relative;

				.bg {
					position: absolute;
					top: 0;
					left: 0;
					width: 485rpx;
					height: 588rpx;

					image {
						@extend .myimg;
					}
				}

				.pbtn3 {
					position: absolute;
					bottom: 33rpx;
					left: 50%;
					transform: translateX(-50%);
					width: 290rpx;
					height: 82rpx;
					line-height: 82rpx;
					font-size: 36rpx;
					color: #fff;
					text-align: center;
					background: linear-gradient(0deg, #FA6823, #FCC1B0);
					border-radius: 41rpx;
				}
			}

			.p2-close {
				width: 58rpx;
				height: 58rpx;
				margin: 60rpx auto 0;

				image {
					@extend .myimg;
				}
			}
		}

		.minus {
			width: 42rpx;
			height: 42rpx;
			border-width: 1px;
			border-color: #E6E6E6;
			@include flex;
			justify-content: center;
			align-items: center;

			image {
				width: 42rpx;
				height: 42rpx;
			}
		}

		.input2 {
			padding: 0 10rpx;
		}

		.plus {
			width: 42rpx;
			height: 42rpx;
			border-radius: 50%;
			/* #ifndef APP-NVUE */
			display: flex;
			/* #endif */
			justify-content: center;
			align-items: center;

			image {
				width: 42rpx;
				height: 42rpx;
			}
		}
	}
</style>
